window.addEventListener('load',function() {
	var menu_courses		= document.getElementById('menu_courses');
	var menu_leaderboards	= document.getElementById('menu_leaderboards');
	var menu_achievement	= document.getElementById('menu_achievement');

	$('#user_rank_level').append("<h1>Level " + localStorage.getItem("estudia_level") + "</h1>");
	$('#user_rank_progressbar_detail').append("<h6>" + localStorage.getItem("estudia_exp") + " / " + "100" + "</h6>");
	
	$( "#user_rank_progressbar" ).progressbar({
      value: parseInt(localStorage.getItem("estudia_exp"))
    });
	
	localStorage.removeItem("estudia_type");
	localStorage.removeItem("estudia_course");
	localStorage.removeItem("estudia_chapter");
	localStorage.removeItem("estudia_maxpage");
	localStorage.removeItem("estudia_ans_right");
	localStorage.removeItem("estudia_ans_false");
	/*
	for(var i = 1; i <= 11; i++) {
		if (i < 10) {
			alert(localStorage.getItem("estudia_achievment_b0" + i));
		} else {
			alert(localStorage.getItem("estudia_achievment_b" + i));
		}
	} // */
	
	menu_courses.onclick=function(){
		window.location.href = '1-courses.html';
	};
	
	menu_leaderboards.onclick=function(){
		window.location.href = '1-Leaderboards.html';
	};
	
	menu_achievement.onclick=function(){
		window.location.href = '1-achievement.html';
	};	

});